import createElement from "../../createElement";
import Popup from "../popup/popup";
import { DialogWindow } from '../Dialog/DialogWindow';

function Gxg() {
  

  let intervalId: NodeJS.Timeout


  function onShow() {
    // setDate()
    // console.log('onShow GXG')
    // setInterval(setDate, 500)
    dialog('哈喽哈喽，下午好呀！',"烈焰杀神果小果")
  }

  function onHide() {
    clearInterval(intervalId)
  }

  function dialog(msg="", title="", options: any={width:400, height:200}){
    const dlog = new DialogWindow({
      title: title,
      content: msg,
      width: options.width,
      height: options.height,
      closeOnOutsideClick: true
    })
    dlog.show()
  } 
  

  return Popup({
    className: 'gxg-popup'
  },
    createElement('div', {
      className: 'gxg-container flex'
    },
      [
        /* createElement('div', {
          className: 'gxg-img'
        },
          [
            createElement('img', {
              src: 'imgs/gxg.png'
            })
          ]
        ) */
      ]
    )
    ,
    {
      onShow,
      onHide
    }
  )
}

export default Gxg()
